package com.nibianplus.volley;


public class VolleyConfig {


	final public static String UA = "Mozilla/4.0 (compatible; MSIE 5.0; Windows XP; DigExt)";
	final public static String content_type_map = "application/x-www-form-urlencoded";
	final public static String content_type_json = "application/json;charset=utf-8";
	final public static String content_type_xml = "text/xml; charset=utf-8";

	/**
	 * 链接超时
	 */
	private int timeout = 30000;
	/**
	 * 字符串的编码 以及服务器的编码
	 */
	private String charset;
	/**
	 * 是否�?要将接口返回内容本地缓存
	 */
	private boolean mShouldCache = false;
	
	
	
	private String tag;
	
	



	private static VolleyConfig defaultConfig = new VolleyConfig(){{
		setCharset("utf-8");
		setTimeout(30000);
		setShouldCache(false);
	}};

	public static VolleyConfig defaultConfig() {
		return defaultConfig;
	}


	public boolean isShouldCache() {
		return mShouldCache;
	}



	public void setShouldCache(boolean mShouldCache) {
		this.mShouldCache = mShouldCache;
	}
	

	public String getCharset() {
		if (charset == null) {
			return defaultConfig().charset;
		}
		return charset;
	}

	public void setCharset(String charset) {
		this.charset = charset;
	}


	public int getTimeout() {
		return timeout;
	}

	public void setTimeout(int timeout) {
		this.timeout = timeout;
	}

	
	public String getTag() {
		return tag;
	}


	public void setTag(String tag) {
		this.tag = tag;
	}
	
}
